﻿using Common.DTOS;
using Common.Net;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// using Newtonsoft.Json;
using UnityEngine;

public partial class NetManager
{
    public void RegisterRequest()
    {
        this.requestDic.Add(RequestType.SLogin, OnSLogin);
        requestDic.Add(RequestType.HelloUdp, OnHelloUdp);
    }

    private void OnHelloUdp(MsgInfo info)
    {
        Debug.Log("OnHelloUdp");
    }

    private void OnSLogin(MsgInfo info)
    {
        var dto = info.vo;
        if (dto is JObject)
        {
            var jobj = dto as JObject;
            var slogin = jobj.ToObject<SLoginDto>();
            Debug.Log("[收到SLogin]:" + slogin.id);
        }
    }
}
